package com.itheima.mybatis.framework;

import org.apache.ibatis.binding.MapperRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ：sean
 * @date ：Created in 2020/6/29
 * @description ：用于保存SqlMapConfig.xml文件中读取的xml信息及映射的SQL语句的集合
 * @version: 1.0
 */
public class HmConfiguration {
  private String driver;
  private String url;
  private String username;
  private String password;
  // 缓存mapper key-映射文件的namespace+id
  private Map<String,HmMapper> mappers = new HashMap<>();

  private HmMapperRegistry mapperRegistry = new HmMapperRegistry(this);

  public HmMapperRegistry getMapperRegistry() {
    return mapperRegistry;
  }

  public Map<String, HmMapper> getMappers() {
    return mappers;
  }

  public void setMappers(Map<String, HmMapper> mappers) {
    this.mappers = mappers;
  }

  public String getDriver() {
    return driver;
  }

  public void setDriver(String driver) {
    this.driver = driver;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

}
